package com.dunshan.prcexp.base.listener;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.dunshan.prcexp.response.content.ResultContent;
import com.dunshan.prcexp.util.RequestUtil;
import org.testng.*;
import org.testng.xml.XmlSuite;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author liwen406
 * @program: dunshan-pef
 * @description:
 * @date 2022-08-25 11:07:32
 */
public class TestListener implements ITestListener, IClassListener, IInvokedMethodListener2, IReporter, IMethodInterceptor, IDataProviderListener {
    public static ThreadLocal<Boolean> threadSaveFlag;
    public static ThreadLocal<Map<String, Object>> threadVariableData;
    public static ThreadLocal<Map<String, Set<String>>> threadFunctionIdMap;
    public static ThreadLocal<List<ResultContent>> threadSignalResultContentList;
    public static ThreadLocal<List<ResultContent>> threadScenelResultContentList;
//    public static ThreadLocal<ConcurrentHashMap<String, GenericService>> threadGenericService;
    public static ThreadLocal<List<String>> threadHost;
    private static List<Map<String, Object>> report = new ArrayList();
    private int totalExecuted = 0;
    private String currentName = "";
    private String topicName;
    private String topicUser;
    private RequestUtil.DhfTaskInfo dhfTaskInfo;

    public TestListener() {
    }

    @Override
    public void onBeforeClass(ITestClass testClass) {

    }

    @Override
    public void onAfterClass(ITestClass testClass) {

    }

    @Override
    public void beforeDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) {

    }

    @Override
    public void afterDataProviderExecution(IDataProviderMethod dataProviderMethod, ITestNGMethod method, ITestContext iTestContext) {

    }

    @Override
    public void beforeInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context) {

    }

    @Override
    public void afterInvocation(IInvokedMethod method, ITestResult testResult, ITestContext context) {

    }

    @Override
    public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {

    }

    @Override
    public void afterInvocation(IInvokedMethod method, ITestResult testResult) {

    }

    @Override
    public List<IMethodInstance> intercept(List<IMethodInstance> methods, ITestContext context) {
        return null;
    }

    @Override
    public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {

    }

    @Override
    public void onTestStart(ITestResult result) {

    }

    @Override
    public void onTestSuccess(ITestResult result) {

    }

    @Override
    public void onTestFailure(ITestResult result) {

    }

    @Override
    public void onTestSkipped(ITestResult result) {

    }

    @Override
    public void onTestFailedButWithinSuccessPercentage(ITestResult result) {

    }

    @Override
    public void onStart(ITestContext context) {

    }

    @Override
    public void onFinish(ITestContext context) {

    }
}
